# 创建images目录（如果不存在）
$imagesDir = Join-Path -Path $PSScriptRoot -ChildPath "images"
if (-not (Test-Path -Path $imagesDir)) {
    New-Item -Path $imagesDir -ItemType Directory
}

# 球队徽标URL
$teamLogos = @{
    "mancity"     = "https://football-logos.com/logos/m/manchester-city.png"
    "realmadrid"  = "https://football-logos.com/logos/r/real-madrid.png"
    "bayern"      = "https://football-logos.com/logos/b/bayern-munich.png"
    "psg"         = "https://football-logos.com/logos/p/psg.png"
    "barcelona"   = "https://football-logos.com/logos/b/barcelona.png"
    "dortmund"    = "https://football-logos.com/logos/b/borussia-dortmund.png"
    "inter"       = "https://football-logos.com/logos/i/inter-milan.png"
    "arsenal"     = "https://football-logos.com/logos/a/arsenal.png"
    "placeholder" = "https://dummyimage.com/200x200/cccccc/ffffff&text=TBD"
}

# 下载图标
foreach ($team in $teamLogos.Keys) {
    $url = $teamLogos[$team]
    $outputFile = Join-Path -Path $imagesDir -ChildPath "$team.png"
    
    try {
        Write-Host "正在下载 $team 图标..."
        Invoke-WebRequest -Uri $url -OutFile $outputFile
        Write-Host "已下载到: $outputFile" -ForegroundColor Green
    } catch {
        Write-Host "下载 $team 图标失败: $_" -ForegroundColor Red
    }
}

Write-Host "`n所有图标下载完成！请刷新欧冠预测页面查看效果。" -ForegroundColor Cyan 